<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class Sign extends Controller
{
    public function webIn(Request $request)
    {
        if ($this->adminGuard()->attempt([
            'username' => $request->username,
            'password' => $request->password,
        ])) {
            return redirect()->route('admin.index');
        } else {
            return back()->withInput();
        }
    }

    public function webOut()
    {
        $this->adminGuard()->logout();
        return redirect()->route('admin.index');
    }
}
